package com.fm.demo.widget

import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager

/**
 * RecyclerView设置LayoutManager
 * <p>
 *     增加单列表类型的上下滑动功能开关
 *     用于少量显示列表，关闭默认滑动效果
 */
class NoScrollLinearLayoutManager(context: Context) : LinearLayoutManager(context) {
    private var isScrollEnable = true


    override fun canScrollVertically(): Boolean {
        return isScrollEnable && super.canScrollVertically()
    }


    fun setScrollEnable(enable: Boolean) {
        isScrollEnable = enable
    }
}